package com.swiftride.feign;

import com.swiftride.fallback.TencentDistanceFeignFallbackFactory;
import com.swiftride.param.TencentDistanceParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(url = "https://apis.map.qq.com/ws/distance/v1/matrix?mode=driving",
        name = "TENCENT-DISTANCE-SERVICE",
        fallbackFactory = TencentDistanceFeignFallbackFactory.class)
public interface TencentDistanceFeign {

    @PostMapping(consumes = "application/json")
    Object calculateDistance(@RequestBody TencentDistanceParam tencentDistanceParam);
}
